﻿Public Class ctrlDGVNhaCungCap
    Event ChonNhaCungCap(nhaCC As tbNhaCungCap)
    Private Sub dgvNhaCungCap_CellDoubleClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvNhaCungCap.CellDoubleClick
        If bsNhaCungCap.Current IsNot Nothing Then
            RaiseEvent ChonNhaCungCap(bsNhaCungCap.Current)
        End If
    End Sub

    Private Sub dgvNhaCungCap_CellValueNeeded(sender As Object, e As DataGridViewCellValueEventArgs) Handles dgvNhaCungCap.CellValueNeeded
        If e.RowIndex >= 0 AndAlso e.ColumnIndex = Me.STT.Index Then
            e.Value = e.RowIndex + 1
        End If
    End Sub

    Event NhaCungCapThayDoi(nhaCC As tbNhaCungCap)
    Private Sub bsNhaCungCap_CurrentChanged(sender As Object, e As EventArgs) Handles bsNhaCungCap.CurrentChanged
        If bsNhaCungCap.Current IsNot Nothing Then
            RaiseEvent NhaCungCapThayDoi(bsNhaCungCap.Current)
        End If
    End Sub

    Private Sub bsNhaCungCap_ListChanged(sender As Object, e As System.ComponentModel.ListChangedEventArgs) Handles bsNhaCungCap.ListChanged
        lblSoDong.Text = bsNhaCungCap.Count.ToString + " nhà cung cấp."
    End Sub

    Private Sub btnIn_Click(sender As Object, e As EventArgs) Handles btnIn.Click
        If bsNhaCungCap.Count > 0 Then

        End If
    End Sub
End Class
